<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var arr = [1, 1, 3, 8, 7, 3, 2, 5, 2, 1, 4, 3, 9, 3, 6, 9, 10, 8, 3, 8];
        var arr1 = [];
        for (var i = 0; i < arr.length; i++) {
            if (arr1.indexOf(arr[i]) < 0) {
                arr1.push(arr[i]);
            }


        }
        alert(arr1);


    </script>

</body>

</html>